<?php

class Page{
    private $content;
    private $tags = array();
    private $delimeter = '|';
    
    public function __construct($content) {
        if(is_file($content)){
            $this->content = file_get_contents($content);
        }
        else{
            $this->content = $content;
        }
    }
    
    public function addTag($name , $value){
        $this->tags[$name] = $value;
    }
    
    public function show(){
        $this->compile();
        echo $this->content;
    }
    
    public function getContent(){
        return $this->content;
    }
    
    public function setContent($content){
        $this->content = $content;
    }
    
    private function compile(){
        foreach ($this->tags as $name => $value){
            $this->content = str_replace($this->delimeter . $name . $this->delimeter, $value, $this->content);
        }
    }
    
}

?>
